Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring for better tracing #887

Merged
merged 5 commits into from
Nov 9, 2023
Merged

Refactoring for better tracing #887

merged 5 commits into from
Nov 9, 2023

Conversation

asmyasnikov
Copy link
Member

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

@asmyasnikov asmyasnikov self-assigned this Nov 8, 2023
Copy link

github-actions bot commented Nov 8, 2023

github.com/ydb-platform/ydb-go-sdk/v3/trace

incompatible changes

DatabaseSQLOnStmtClose: changed from func(*DatabaseSQL) func(error) to func(*DatabaseSQL, *context.Context) func(error)
DatabaseSQLOnStmtExec: changed from func(*DatabaseSQL, *context.Context, string) func(error) to func(*DatabaseSQL, *context.Context, *context.Context, string) func(error)
DatabaseSQLOnStmtQuery: changed from func(*DatabaseSQL, *context.Context, string) func(error) to func(*DatabaseSQL, *context.Context, *context.Context, string) func(error)
DatabaseSQLOnTxExec: changed from func(*DatabaseSQL, *context.Context, context.Context, tableTransactionInfo, string, bool) func(error) to func(*DatabaseSQL, *context.Context, *context.Context, tableTransactionInfo, string) func(error)
DatabaseSQLOnTxQuery: changed from func(*DatabaseSQL, *context.Context, context.Context, tableTransactionInfo, string, bool) func(error) to func(*DatabaseSQL, *context.Context, *context.Context, tableTransactionInfo, string) func(error)
DatabaseSQLTxCommitStartInfo.Context: removed
DatabaseSQLTxExecStartInfo.Idempotent: removed
DatabaseSQLTxExecStartInfo.TxContext: changed from context.Context to *context.Context
DatabaseSQLTxQueryStartInfo.Idempotent: removed
DatabaseSQLTxQueryStartInfo.TxContext: changed from context.Context to *context.Context
DatabaseSQLTxRollbackStartInfo.Context: removed
DiscoveryOnDiscover: changed from func(*Discovery, *context.Context, string, string) func(location string, endpoints []EndpointInfo, _ error) to func(*Discovery, *context.Context, call, string, string) func(location string, endpoints []EndpointInfo, _ error)
DiscoveryOnWhoAmI: changed from func(*Discovery, *context.Context) func(user string, groups []string, _ error) to func(*Discovery, *context.Context, call) func(user string, groups []string, _ error)
DriverOnBalancerChooseEndpoint: changed from func(*Driver, *context.Context) func(endpoint EndpointInfo, _ error) to func(*Driver, *context.Context, call) func(endpoint EndpointInfo, _ error)
DriverOnBalancerClose: changed from func(*Driver, *context.Context) func(error) to func(*Driver, *context.Context, call) func(error)
DriverOnBalancerClusterDiscoveryAttempt: changed from func(*Driver, *context.Context, string) func(error) to func(*Driver, *context.Context, call, string) func(error)
DriverOnBalancerDialEntrypoint: changed from func(*Driver, *context.Context, string) func(error) to func(*Driver, *context.Context, call, string) func(error)
DriverOnBalancerInit: changed from func(*Driver, *context.Context) func(error) to func(*Driver, *context.Context, call) func(error)
DriverOnBalancerUpdate: changed from func(*Driver, *context.Context, bool) func(endpoints []EndpointInfo, localDC string, _ error) to func(*Driver, *context.Context, call, bool) func(endpoints []EndpointInfo, localDC string, _ error)
DriverOnClose: changed from func(*Driver, *context.Context) func(error) to func(*Driver, *context.Context, call) func(error)
DriverOnConnAllow: changed from func(*Driver, *context.Context, EndpointInfo, ConnState) func(state ConnState) to func(*Driver, *context.Context, call, EndpointInfo, ConnState) func(state ConnState)
DriverOnConnBan: changed from func(*Driver, *context.Context, EndpointInfo, ConnState, error) func(state ConnState) to func(*Driver, *context.Context, call, EndpointInfo, ConnState, error) func(state ConnState)
DriverOnConnClose: changed from func(*Driver, *context.Context, EndpointInfo) func(error) to func(*Driver, *context.Context, call, EndpointInfo) func(error)
DriverOnConnDial: changed from func(*Driver, *context.Context, EndpointInfo) func(error) to func(*Driver, *context.Context, call, EndpointInfo) func(error)
DriverOnConnInvoke: changed from func(*Driver, *context.Context, EndpointInfo, Method) func(_ error, issues []Issue, opID string, state ConnState, metadata map[string][]string) to func(*Driver, *context.Context, call, EndpointInfo, Method) func(_ error, issues []Issue, opID string, state ConnState, metadata map[string][]string)
DriverOnConnNewStream: changed from func(*Driver, *context.Context, EndpointInfo, Method) func(error) func(_ error, state ConnState, metadata map[string][]string) to func(*Driver, *context.Context, call, EndpointInfo, Method) func(error) func(_ error, state ConnState, metadata map[string][]string)
DriverOnConnPark: changed from func(*Driver, *context.Context, EndpointInfo) func(error) to func(*Driver, *context.Context, call, EndpointInfo) func(error)
DriverOnConnStateChange: changed from func(*Driver, EndpointInfo, ConnState) func(state ConnState) to func(*Driver, *context.Context, call, EndpointInfo, ConnState) func(state ConnState)
DriverOnConnTake: changed from func(*Driver, *context.Context, EndpointInfo) func(error) to func(*Driver, *context.Context, call, EndpointInfo) func(error)
DriverOnGetCredentials: changed from func(*Driver, *context.Context) func(token string, _ error) to func(*Driver, *context.Context, call) func(token string, _ error)
DriverOnInit: changed from func(*Driver, *context.Context, string, string, bool) func(error) to func(*Driver, *context.Context, call, string, string, bool) func(error)
DriverOnNetClose: changed from func(*Driver, string) func(error) to func(*Driver, call, string) func(error)
DriverOnNetDial: changed from func(*Driver, *context.Context, string) func(error) to func(*Driver, *context.Context, call, string) func(error)
DriverOnNetRead: changed from func(*Driver, string, int) func(received int, _ error) to func(*Driver, call, string, int) func(received int, _ error)
DriverOnNetWrite: changed from func(*Driver, string, int) func(sent int, _ error) to func(*Driver, call, string, int) func(sent int, _ error)
DriverOnRepeaterWakeUp: changed from func(*Driver, *context.Context, string, string) func(error) to func(*Driver, *context.Context, call, string, string) func(error)
DriverOnResolve: changed from func(*Driver, string, []string) func(error) to func(*Driver, call, string, []string) func(error)
RetryOnRetry: changed from func(*Retry, *context.Context, string, string, bool, bool) func(error) func(attempts int, _ error) to func(*Retry, *context.Context, string, call, string, bool, bool) func(error) func(attempts int, _ error)
Scheme: old is comparable, new is not
ScriptingOnClose: changed from func(*Scripting, *context.Context) func(error) to func(*Scripting, *context.Context, call) func(error)
ScriptingOnExecute: changed from func(*Scripting, *context.Context, string, scriptingQueryParameters) func(result scriptingResult, _ error) to func(*Scripting, *context.Context, call, string, scriptingQueryParameters) func(result scriptingResult, _ error)
ScriptingOnExplain: changed from func(*Scripting, *context.Context, string) func(plan string, _ error) to func(*Scripting, *context.Context, call, string) func(plan string, _ error)
ScriptingOnStreamExecute: changed from func(*Scripting, *context.Context, string, scriptingQueryParameters) func(error) func(error) to func(*Scripting, *context.Context, call, string, scriptingQueryParameters) func(error) func(error)
TableOnClose: changed from func(*Table, *context.Context) func(error) to func(*Table, *context.Context, call) func(error)
TableOnCreateSession: changed from func(*Table, *context.Context) func(error) func(session tableSessionInfo, attempts int, _ error) to func(*Table, *context.Context, call) func(error) func(session tableSessionInfo, attempts int, _ error)
TableOnDo: changed from func(*Table, *context.Context, string, string, bool, bool) func(error) func(attempts int, _ error) to func(*Table, *context.Context, call, string, string, bool, bool) func(error) func(attempts int, _ error)
TableOnDoTx: changed from func(*Table, *context.Context, string, string, bool, bool) func(error) func(attempts int, _ error) to func(*Table, *context.Context, call, string, string, bool, bool) func(error) func(attempts int, _ error)
TableOnInit: changed from func(*Table, *context.Context) func(limit int, _ error) to func(*Table, *context.Context, call) func(limit int, _ error)
TableOnPoolGet: changed from func(*Table, *context.Context) func(session tableSessionInfo, attempts int, _ error) to func(*Table, *context.Context, call) func(session tableSessionInfo, attempts int, _ error)
TableOnPoolPut: changed from func(*Table, *context.Context, tableSessionInfo) func(error) to func(*Table, *context.Context, call, tableSessionInfo) func(error)
TableOnPoolSessionClose: changed from func(*Table, *context.Context, tableSessionInfo) func() to func(*Table, *context.Context, call, tableSessionInfo) func()
TableOnPoolSessionNew: changed from func(*Table, *context.Context) func(session tableSessionInfo, _ error) to func(*Table, *context.Context, call) func(session tableSessionInfo, _ error)
TableOnPoolWait: changed from func(*Table, *context.Context) func(session tableSessionInfo, _ error) to func(*Table, *context.Context, call) func(session tableSessionInfo, _ error)
TableOnSessionDelete: changed from func(*Table, *context.Context, tableSessionInfo) func(error) to func(*Table, *context.Context, call, tableSessionInfo) func(error)
TableOnSessionKeepAlive: changed from func(*Table, *context.Context, tableSessionInfo) func(error) to func(*Table, *context.Context, call, tableSessionInfo) func(error)
TableOnSessionNew: changed from func(*Table, *context.Context) func(session tableSessionInfo, _ error) to func(*Table, *context.Context, call) func(session tableSessionInfo, _ error)
TableOnSessionQueryExecute: changed from func(*Table, *context.Context, tableSessionInfo, tableDataQuery, tableQueryParameters, bool) func(tx tableTransactionInfo, prepared bool, result tableResult, _ error) to func(*Table, *context.Context, call, tableSessionInfo, tableDataQuery, tableQueryParameters, bool) func(tx tableTransactionInfo, prepared bool, result tableResult, _ error)
TableOnSessionQueryExplain: changed from func(*Table, *context.Context, tableSessionInfo, string) func(aST string, plan string, _ error) to func(*Table, *context.Context, call, tableSessionInfo, string) func(aST string, plan string, _ error)
TableOnSessionQueryPrepare: changed from func(*Table, *context.Context, tableSessionInfo, string) func(result tableDataQuery, _ error) to func(*Table, *context.Context, call, tableSessionInfo, string) func(result tableDataQuery, _ error)
TableOnSessionQueryStreamExecute: changed from func(*Table, *context.Context, tableSessionInfo, tableDataQuery, tableQueryParameters) func(error) func(error) to func(*Table, *context.Context, call, tableSessionInfo, tableDataQuery, tableQueryParameters) func(error) func(error)
TableOnSessionQueryStreamRead: changed from func(*Table, *context.Context, tableSessionInfo) func(error) func(error) to func(*Table, *context.Context, call, tableSessionInfo) func(error) func(error)
TableOnSessionTransactionBegin: changed from func(*Table, *context.Context, tableSessionInfo) func(tx tableTransactionInfo, _ error) to func(*Table, *context.Context, call, tableSessionInfo) func(tx tableTransactionInfo, _ error)
TableOnSessionTransactionCommit: changed from func(*Table, *context.Context, tableSessionInfo, tableTransactionInfo) func(error) to func(*Table, *context.Context, call, tableSessionInfo, tableTransactionInfo) func(error)
TableOnSessionTransactionExecute: changed from func(*Table, *context.Context, tableSessionInfo, tableTransactionInfo, tableDataQuery, tableQueryParameters) func(result tableResult, _ error) to func(*Table, *context.Context, call, tableSessionInfo, tableTransactionInfo, tableDataQuery, tableQueryParameters) func(result tableResult, _ error)
TableOnSessionTransactionExecuteStatement: changed from func(*Table, *context.Context, tableSessionInfo, tableTransactionInfo, tableDataQuery, tableQueryParameters) func(result tableResult, _ error) to func(*Table, *context.Context, call, tableSessionInfo, tableTransactionInfo, tableDataQuery, tableQueryParameters) func(result tableResult, _ error)
TableOnSessionTransactionRollback: changed from func(*Table, *context.Context, tableSessionInfo, tableTransactionInfo) func(error) to func(*Table, *context.Context, call, tableSessionInfo, tableTransactionInfo) func(error)

compatible changes

DatabaseSQL.OnConnIsTableExists: added
DatabaseSQL.OnTxPrepare: added
DatabaseSQLConnIsTableExistsDoneInfo: added
DatabaseSQLConnIsTableExistsStartInfo: added
DatabaseSQLOnConnIsTableExists: added
DatabaseSQLOnTxPrepare: added
DatabaseSQLStmtCloseStartInfo.StmtContext: added
DatabaseSQLStmtExecStartInfo.StmtContext: added
DatabaseSQLStmtQueryStartInfo.StmtContext: added
DatabaseSQLTxCommitStartInfo.TxContext: added
DatabaseSQLTxPrepareDoneInfo: added
DatabaseSQLTxPrepareStartInfo: added
DatabaseSQLTxRollbackStartInfo.TxContext: added
DiscoveryDiscoverStartInfo.Call: added
DiscoveryWhoAmIStartInfo.Call: added
Driver.OnPoolNew: added
Driver.OnPoolRelease: added
DriverBalancerChooseEndpointStartInfo.Call: added
DriverBalancerCloseStartInfo.Call: added
DriverBalancerClusterDiscoveryAttemptStartInfo.Call: added
DriverBalancerDialEntrypointStartInfo.Call: added
DriverBalancerInitStartInfo.Call: added
DriverBalancerUpdateStartInfo.Call: added
DriverCloseStartInfo.Call: added
DriverConnAllowStartInfo.Call: added
DriverConnBanStartInfo.Call: added
DriverConnCloseStartInfo.Call: added
DriverConnDialStartInfo.Call: added
DriverConnInvokeStartInfo.Call: added
DriverConnNewStreamStartInfo.Call: added
DriverConnParkStartInfo.Call: added
DriverConnPoolNewDoneInfo: added
DriverConnPoolNewStartInfo: added
DriverConnPoolReleaseDoneInfo: added
DriverConnPoolReleaseStartInfo: added
DriverConnStateChangeStartInfo.Call: added
DriverConnStateChangeStartInfo.Context: added
DriverConnTakeStartInfo.Call: added
DriverGetCredentialsStartInfo.Call: added
DriverInitStartInfo.Call: added
DriverNetCloseStartInfo.Call: added
DriverNetDialStartInfo.Call: added
DriverNetReadStartInfo.Call: added
DriverNetWriteStartInfo.Call: added
DriverOnPoolNew: added
DriverOnPoolRelease: added
DriverRepeaterWakeUpStartInfo.Call: added
DriverResolveStartInfo.Call: added
RetryLoopStartInfo.Call: added
Scheme.OnDescribePath: added
Scheme.OnListDirectory: added
Scheme.OnMakeDirectory: added
Scheme.OnModifyPermissions: added
Scheme.OnRemoveDirectory: added
SchemeDescribePathDoneInfo: added
SchemeDescribePathStartInfo: added
SchemeListDirectoryDoneInfo: added
SchemeListDirectoryStartInfo: added
SchemeMakeDirectoryDoneInfo: added
SchemeMakeDirectoryStartInfo: added
SchemeModifyPermissionsDoneInfo: added
SchemeModifyPermissionsStartInfo: added
SchemeOnDescribePath: added
SchemeOnListDirectory: added
SchemeOnMakeDirectory: added
SchemeOnModifyPermissions: added
SchemeOnRemoveDirectory: added
SchemeRemoveDirectoryDoneInfo: added
SchemeRemoveDirectoryStartInfo: added
ScriptingCloseStartInfo.Call: added
ScriptingExecuteStartInfo.Call: added
ScriptingExplainStartInfo.Call: added
ScriptingStreamExecuteStartInfo.Call: added
Table.OnSessionBulkUpsert: added
TableBulkUpsertDoneInfo: added
TableBulkUpsertStartInfo: added
TableCloseStartInfo.Call: added
TableCreateSessionStartInfo.Call: added
TableDoStartInfo.Call: added
TableDoTxStartInfo.Call: added
TableExecuteDataQueryStartInfo.Call: added
TableExplainQueryStartInfo.Call: added
TableInitStartInfo.Call: added
TableKeepAliveStartInfo.Call: added
TableOnSessionBulkUpsert: added
TablePoolGetStartInfo.Call: added
TablePoolPutStartInfo.Call: added
TablePoolSessionCloseStartInfo.Call: added
TablePoolSessionNewStartInfo.Call: added
TablePoolWaitStartInfo.Call: added
TablePrepareDataQueryStartInfo.Call: added
TableSessionDeleteStartInfo.Call: added
TableSessionNewStartInfo.Call: added
TableSessionQueryStreamExecuteStartInfo.Call: added
TableSessionQueryStreamReadStartInfo.Call: added
TableSessionTransactionBeginStartInfo.Call: added
TableSessionTransactionCommitStartInfo.Call: added
TableSessionTransactionRollbackStartInfo.Call: added
TableTransactionExecuteStartInfo.Call: added
TableTransactionExecuteStatementStartInfo.Call: added

summary

Base version: v3.54.2-0.20231108105648-3d4ec7a9da14 (master)
Cannot suggest a release version.
Can only suggest a release version when compared against the most recent version of this major: v3.54.1.

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2023

Codecov Report

Attention: 50 lines in your changes are missing coverage. Please review.

Comparison is base (3d4ec7a) 66.79% compared to head (935a5ad) 66.82%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #887      +/-   ##
==========================================
+ Coverage   66.79%   66.82%   +0.03%     
==========================================
  Files         256      257       +1     
  Lines       24237    24266      +29     
==========================================
+ Hits        16188    16216      +28     
- Misses       7213     7215       +2     
+ Partials      836      835       -1     
Flag Coverage Δ
53.41% <78.15%> (+0.04%) ⬆️
go-1.17.x 65.30% <78.99%> (+0.11%) ⬆️
go-1.20.x 66.71% <78.99%> (+0.07%) ⬆️
go-1.21.x 66.53% <78.99%> (+0.09%) ⬆️
integration 53.41% <78.15%> (+0.04%) ⬆️
macOS 38.96% <15.72%> (-0.14%) ⬇️
ubuntu 39.00% <15.72%> (-0.10%) ⬇️
unit 39.07% <15.72%> (-0.12%) ⬇️
windows 39.05% <15.72%> (-0.12%) ⬇️
ydb-22.5 52.83% <78.15%> (-0.09%) ⬇️
ydb-23.1 53.05% <78.15%> (+0.08%) ⬆️
ydb-23.2 53.07% <78.15%> (-0.01%) ⬇️
ydb-23.3 53.25% <78.15%> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
internal/balancer/balancer.go 82.70% <100.00%> (-0.29%) ⬇️
internal/conn/conn.go 73.83% <100.00%> (-0.89%) ⬇️
internal/conn/pool.go 86.98% <100.00%> (+0.08%) ⬆️
internal/discovery/discovery.go 61.90% <100.00%> (+0.73%) ⬆️
internal/meta/meta.go 64.93% <100.00%> (ø)
internal/repeater/repeater.go 90.83% <100.00%> (ø)
internal/scripting/client.go 72.68% <100.00%> (ø)
internal/stack/function_id.go 100.00% <100.00%> (ø)
internal/table/client.go 87.25% <100.00%> (-0.58%) ⬇️
internal/table/retry.go 80.37% <100.00%> (ø)
... and 15 more

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Nov 8, 2023

🌋 Here are results of SLO test for Go SDK database/sql:

Grafana Dashboard

SLO-databasesql

Copy link

github-actions bot commented Nov 8, 2023

🌋 Here are results of SLO test for Go SDK gorm:

Grafana Dashboard

SLO-gorm

Copy link

github-actions bot commented Nov 8, 2023

🌋 Here are results of SLO test for Go SDK xorm:

Grafana Dashboard

SLO-xorm

Copy link

github-actions bot commented Nov 8, 2023

🌋 Here are results of SLO test for Go SDK native:

Grafana Dashboard

SLO-native

@asmyasnikov asmyasnikov merged commit 13c5744 into master Nov 9, 2023
48 of 49 checks passed
@asmyasnikov asmyasnikov deleted the tracing branch November 9, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants